//
//  StoreDetailEvaluationCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/14.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "StoreDetailEvaluationCell.h"

@implementation StoreDetailEvaluationCell

+ (CGFloat)calculateHeightWithModel:(CommonEvaluateModel *)model {

    NSString *content = [NSString stringWithFormat:@"%@：%@",model.ueEvaluateUserName,model.ueEvaluateContent];
    CGFloat labelHeight = [Utilities getStringHeightWithText:content font:[UIFont systemFontOfSize:9] viewWidth:TTScreenWidth-50];

    return labelHeight + 40;
}

- (void)awakeFromNib {
    [super awakeFromNib];






}

- (void)fillCellWithModel:(CommonEvaluateModel *)model {
    
    NSString *content = [NSString stringWithFormat:@"%@：%@",model.ueEvaluateUserName,model.ueEvaluateContent];

    // 下划线
    NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:content];
    [attribtStr addAttribute:NSForegroundColorAttributeName value:UIColorHex(0x333333) range:NSMakeRange(0,model.ueEvaluateUserName.length)];
    [attribtStr addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:9] range:NSMakeRange(0,model.ueEvaluateUserName.length)];

    //赋值
    self.evaluatLab.attributedText = attribtStr;
}


- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.evaluatBGView pp_clipCorners:UIRectCornerAllCorners radius:6];
    });
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
